package com.yumi.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 培训记录实体类
 */
@Data
@TableName("work_training_record")
@Schema(description = "培训记录信息")
public class TrainingRecord {

    /**
     * 记录ID
     */
    @TableId(type = IdType.AUTO)
    @Schema(description = "记录ID")
    private Long id;

    /**
     * 关联培训计划ID
     */
    @NotNull(message = "培训计划ID不能为空")
    @Schema(description = "培训计划ID", required = true)
    private Long trainingId;

    /**
     * 参训员工ID
     */
    @NotNull(message = "员工ID不能为空")
    @Schema(description = "参训员工ID", required = true)
    private Long employeeId;

    /**
     * 出勤状态：0-未签到 1-已签到 2-迟到 3-早退 4-缺席
     */
    @Schema(description = "出勤状态：0-未签到 1-已签到 2-迟到 3-早退 4-缺席", defaultValue = "0")
    private Integer attendance;

    /**
     * 考核得分（100分制）
     */
    @DecimalMin(value = "0", message = "分数不能低于0")
    @DecimalMax(value = "100", message = "分数不能高于100")
    @Schema(description = "考核得分（100分制）")
    private BigDecimal score;

    /**
     * 评价反馈
     */
    @Schema(description = "评价反馈")
    private String feedback;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间", accessMode = Schema.AccessMode.READ_ONLY)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间", accessMode = Schema.AccessMode.READ_ONLY)
    private LocalDateTime updateTime;

    /**
     * 是否删除（0-未删除 1-已删除）
     */
    @TableLogic
    @Schema(description = "是否删除", accessMode = Schema.AccessMode.READ_ONLY)
    private Integer isDeleted;
} 